﻿using CSharpDesign.DAL;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;

namespace CSharpDesign.BLL
{
    public class AddAdminService
    {
        SqlHelper data = new SqlHelper();
        //
        // TODO: 在此处添加构造函数逻辑
        //
        public string AddAdmin(SqlCommand cmd,string pwd, string name)
        {
            
            cmd.CommandText = "insert into Admin (Apwd,Aname,Roule)values(@Apwd,@Aname,@Roule)";
            cmd.Parameters.Add("@Apwd", SqlDbType.VarChar);
            cmd.Parameters.Add("@Aname", SqlDbType.VarChar);
            cmd.Parameters.Add("@Roule", SqlDbType.VarChar);


            cmd.Parameters["@Apwd"].Value = pwd;

            cmd.Parameters["@Aname"].Value = name;
            cmd.Parameters["@Roule"].Value = "超级管理员";
            return name;
        }
    }
}